<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ include file="/WEB-INF/views/include/taglib.jsp" %>
<%--流程图表--%>
<%--<div id="flowChart" style="width: 860px;height: 400px;margin:30px 0;"></div>--%>
<form:form commandName="task" cssClass="form-horizontal" role="form" onsubmit="return false;">
    <h3 style="margin: 0px 0px 10px 0;">当前项目详情</h3>
    <div class="form-group">
        <div class="col-sm-12">
            <textarea rows="2" id="projectDetail" name="taskContent" placeholder="项目详情（主要问题）" readonly
                      class="form-control ">${projectDetail}</textarea>
        </div>
    </div>

    <div class="form-group">
        <label class="col-sm-1 control-label no-padding-right" for="helpInfo_addProblem">问题描述</label>
        <div class="col-sm-11">
            <textarea rows="3" id="helpInfo_addProblem" name="feedback" placeholder="填写要反馈的问题，等待攻坚办审核"
                      class="form-control "></textarea>
        </div>
    </div>
    <div class="form-group">
        <label class="col-sm-1 control-label no-padding-right">佐证材料</label>
        <input class="col-sm-3" type="file" id="fileupload" name="files"/>
        <button class="col-sm-2 btn btn-large btn-primary" id="btn-upload">上传</button>
    </div>
    <div class="form-group">
        <label class="col-sm-12" style="color: red;">点击确定，将该项目节点的问题反馈给攻坚办！(如需上传材料，请先上传材料再点击确定)</label>
    </div>
    <div class="form-group">
        <label class="col-sm-12" >*注：1周内最多只能发起1次攻坚！</label>
    </div>

    <input type="text" id="taskId" value="${task.sysId}" hidden>
    <input type="text" name="taxproof" id="taxproof_proof" hidden>
    <form:hidden path="sysId"/>

</form:form>
<hr width="100%;height:2px;">
<div class="row" style="margin-left: 2px;">
    * 以上按住如此标志：<img src="/assets/web/img/zzc.png"  alt="提示" />可拖动调整相应输入框大小
</div>
<script src="<s:url value="/assets/js/ajaxfileupload.js"></s:url>"></script>
<script type="text/javascript">
    /**
     * 上传材料
     */
    $("#btn-upload").click(function () {
        var fileval = $("#fileupload").val();
        if (fileval == null || fileval == "") {
            alert("未选择任何文件");
            return;
        }
        $(".shade").fadeIn(100);
        $(".warning").fadeIn(100);
        $('.la-square-jelly-box').show();
        showShade();
        //警告框自定义内容
        $('.warning>.title>em').html('加载中……');
        $.ajaxFileUpload({
            type: "post",
            fileElementId: "fileupload",
            secureuri: false,
            dataType: 'text',
            url: "/communal/uploadBatch",
            async: false,
            success: function (data) {

                var data = JSON.parse(data);
                var val = data.data.sysid;
                $("#taxproof_proof").attr("value", val);
                if (data.code === "200") {
                    $('.warning>.title>em').html('上传成功');
                } else {
                    $('.warning>.title>em').html('上传失败');
                }
            },
            error: function () {
                alert("佐证材料上传失败 ！！请联系管理员");
            }
        });
    });
</script>